(define-module (string-helpers)
  #:use-module (rnrs base)
  #:use-module ((guile) #:select (lambda* λ
                                  when
                                  call-with-output-string))
  #:use-module (ice-9 textual-ports)
  #:export (char->string
            string-repeat))


(define char->string
  (λ (char)
    (list->string (list char))))


(define (string-repeat str n)
  (call-with-output-string
    (λ (port)
      (let iter ([count° n])
        (when (> count° 0)
          (put-string port str)
          (iter (- count° 1)))))))
